import { ref } from "vue";
interface Nva {
    label: string,
    value: string
}

const endChar = 'USDT';
const commFun = {
    getForm: function (bol: boolean, char: string, long = false) {
        if(!char) return "";
        if(long){
            if(char.includes(":")){
                char = char.split(":")[1];
            }
        }
        if (bol) {
            return char.slice(0, char.indexOf(endChar));
        } else {
            return char.slice(char.lastIndexOf(endChar));
        }
    }
}
const list = [
    {
        label: "5m",
        value: "MN5"
    },
    {
        label: "15m",
        value: "MN15"
    },
    {
        label: "30m",
        value: "MN30"
    },
    {
        label: "1h",
        value: "H1"
    },
    {
        label: "4h",
        value: "H4"
    },
    {
        label: "1day",
        value: "D1"
    }
];

const volatility = {
    title_nvas: ref(list),
    nvas_: ref(list[0]),
}
export { commFun, volatility };
export type { Nva };
